<template>
  <div class="hello">
    <p>brand:{{brand}}</p>
    <p>content:{{content}}</p>
    <p>place:{{place}}</p>
    <p>storage:{{storage}}</p>
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item>
        <el-button type="primary" @click="onSubmit">GET</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    data() {
      return {
        brand: "",
        content: "",
        place: "",
        storage: ""
      }
    },
    methods: {
      onSubmit() {
        console.log(this.form);
        const that = this;
        axios.get("http://47.110.234.216:7001/get-pros", {
          params: {
            pageNum: 1,
            pageSize: 2
          }
        }).then(res => {
          const a = res.data.datas[0].norms[0];
          console.log(a),
            that.brand = a.brand;
          that.content = a.content;
          that.place = a.place;
          that.storage = a.storage;

        });

      }
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  el-input {
    width: 600px;
  }

  h1, h2 {
    font-weight: normal;
  }

  ul {
    list-style-type: none;
    padding: 0;
  }

  li {
    display: inline-block;
    margin: 0 10px;
  }

  a {
    color: #42b983;
  }
</style>
